<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html" charset="UTF-8">
<title>ColognePhonetic (Commons Codec 1.8 API)</title>
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
    if (location.href.indexOf('is-external=true') == -1) {
        parent.document.title="ColognePhonetic (Commons Codec 1.8 API)";
    }
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!--   -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!--   -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/ColognePhonetic.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../org/apache/commons/codec/language/Caverphone2.html" title="class in org.apache.commons.codec.language"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../../org/apache/commons/codec/language/DoubleMetaphone.html" title="class in org.apache.commons.codec.language"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/commons/codec/language/ColognePhonetic.html" target="_top">Frames</a></li>
<li><a href="ColognePhonetic.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
  allClassesLink = document.getElementById("allclasses_navbar_top");
  if(window==top) {
    allClassesLink.style.display = "block";
  }
  else {
    allClassesLink.style.display = "none";
  }
  //-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_top">
<!--   -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">org.apache.commons.codec.language</div>
<h2 title="Class ColognePhonetic" class="title">Class ColognePhonetic</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li><a href="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</a></li>
<li>
<ul class="inheritance">
<li>org.apache.commons.codec.language.ColognePhonetic</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Implemented Interfaces:</dt>
<dd><a href="../../../../../org/apache/commons/codec/Encoder.html" title="interface in org.apache.commons.codec">Encoder</a>, <a href="../../../../../org/apache/commons/codec/StringEncoder.html" title="interface in org.apache.commons.codec">StringEncoder</a></dd>
</dl>
<hr>
<br>
<pre>public class <span class="strong">ColognePhonetic</span>
extends <a href="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>
implements <a href="../../../../../org/apache/commons/codec/StringEncoder.html" title="interface in org.apache.commons.codec">StringEncoder</a></pre>
<div class="block">Encodes a string into a Cologne Phonetic value.
 <p>
 Implements the <a href="http://de.wikipedia.org/wiki/K%C3%B6lner_Phonetik">K&ouml;lner Phonetik</a>
 (Cologne Phonetic) algorithm issued by Hans Joachim Postel in 1969.
 <p>
 The <i>K&ouml;lner Phonetik</i> is a phonetic algorithm which is optimized for the German language.
 It is related to the well-known soundex algorithm.
 <p>

 <h2>Algorithm</h2>

 <ul>

 <li>
 <h3>Step 1:</h3>
 After preprocessing (conversion to upper case, transcription of <a
 href="http://en.wikipedia.org/wiki/Germanic_umlaut">germanic umlauts</a>, removal of non alphabetical characters) the
 letters of the supplied text are replaced by their phonetic code according to the following table.
 <table border="1">
 <tbody>
 <tr>
 <th>Letter</th>
 <th>Context</th>
 <th align="center">Code</th>
 </tr>
 <tr>
 <td>A, E, I, J, O, U, Y</td>
 <td></td>
 <td align="center">0</td>
 </tr>
 <tr>

 <td>H</td>
 <td></td>
 <td align="center">-</td>
 </tr>
 <tr>
 <td>B</td>
 <td></td>
 <td rowspan="2" align="center">1</td>
 </tr>
 <tr>
 <td>P</td>
 <td>not before H</td>

 </tr>
 <tr>
 <td>D, T</td>
 <td>not before C, S, Z</td>
 <td align="center">2</td>
 </tr>
 <tr>
 <td>F, V, W</td>
 <td></td>
 <td rowspan="2" align="center">3</td>
 </tr>
 <tr>

 <td>P</td>
 <td>before H</td>
 </tr>
 <tr>
 <td>G, K, Q</td>
 <td></td>
 <td rowspan="3" align="center">4</td>
 </tr>
 <tr>
 <td rowspan="2">C</td>
 <td>at onset before A, H, K, L, O, Q, R, U, X</td>

 </tr>
 <tr>
 <td>before A, H, K, O, Q, U, X except after S, Z</td>
 </tr>
 <tr>
 <td>X</td>
 <td>not after C, K, Q</td>
 <td align="center">48</td>
 </tr>
 <tr>
 <td>L</td>
 <td></td>

 <td align="center">5</td>
 </tr>
 <tr>
 <td>M, N</td>
 <td></td>
 <td align="center">6</td>
 </tr>
 <tr>
 <td>R</td>
 <td></td>
 <td align="center">7</td>
 </tr>

 <tr>
 <td>S, Z</td>
 <td></td>
 <td rowspan="6" align="center">8</td>
 </tr>
 <tr>
 <td rowspan="3">C</td>
 <td>after S, Z</td>
 </tr>
 <tr>
 <td>at onset except before A, H, K, L, O, Q, R, U, X</td>
 </tr>

 <tr>
 <td>not before A, H, K, O, Q, U, X</td>
 </tr>
 <tr>
 <td>D, T</td>
 <td>before C, S, Z</td>
 </tr>
 <tr>
 <td>X</td>
 <td>after C, K, Q</td>
 </tr>
 </tbody>
 </table>
 <p>
 <small><i>(Source: <a href= "http://de.wikipedia.org/wiki/K%C3%B6lner_Phonetik#Buchstabencodes" >Wikipedia (de):
 K&ouml;lner Phonetik -- Buchstabencodes</a>)</i></small>
 </p>

 <h4>Example:</h4>

 <code>"M</code>&uuml;<code>ller-L</code>&uuml;<code>denscheidt" =&gt; "MULLERLUDENSCHEIDT" =&gt; "6005507500206880022"</code>

 </li>

 <li>
 <h3>Step 2:</h3>
 Collapse of all multiple consecutive code digits.
 <h4>Example:</h4>
 <code>"6005507500206880022" =&gt; "6050750206802"</code></li>

 <li>
 <h3>Step 3:</h3>
 Removal of all codes "0" except at the beginning. This means that two or more identical consecutive digits can occur
 if they occur after removing the "0" digits.

 <h4>Example:</h4>
 <code>"6050750206802" =&gt; "65752682"</code></li>

 </ul>

 This class is thread-safe.</div>
<dl><dt><span class="strong">Since:</span></dt>
  <dd>1.5</dd>
<dt><span class="strong">See Also:</span></dt><dd><a href="http://de.wikipedia.org/wiki/K%C3%B6lner_Phonetik">Wikipedia (de): K&ouml;lner Phonetik (in German)</a></dd></dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_summary">
<!--   -->
</a>
<h3>Constructor Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><strong><a href="../../../../../org/apache/commons/codec/language/ColognePhonetic.html#ColognePhonetic()">ColognePhonetic</a></strong>()</code>&nbsp;</td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method_summary">
<!--   -->
</a>
<h3>Method Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span>Methods</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/codec/language/ColognePhonetic.html#colognePhonetic(java.lang.String)">colognePhonetic</a></strong>(<a href="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;text)</code>
<div class="block">
 Implements the <i>K&ouml;lner Phonetik</i> algorithm.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/codec/language/ColognePhonetic.html#encode(java.lang.Object)">encode</a></strong>(<a href="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;object)</code>
<div class="block">Encodes an "Object" and returns the encoded content as an Object.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/codec/language/ColognePhonetic.html#encode(java.lang.String)">encode</a></strong>(<a href="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;text)</code>
<div class="block">Encodes a String and returns a String.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/codec/language/ColognePhonetic.html#isEncodeEqual(java.lang.String, java.lang.String)">isEncodeEqual</a></strong>(<a href="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;text1,
             <a href="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;text2)</code>&nbsp;</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_java.lang.Object">
<!--   -->
</a>
<h3>Methods inherited from class&nbsp;java.lang.<a href="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3>
<code><a href="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</a>, <a href="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</a>, <a href="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</a>, <a href="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</a>, <a href="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</a>, <a href="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</a>, <a href="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</a>, <a href="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</a>, <a href="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</a>, <a href="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</a>, <a href="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait</a></code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_detail">
<!--   -->
</a>
<h3>Constructor Detail</h3>
<a name="ColognePhonetic()">
<!--   -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>ColognePhonetic</h4>
<pre>public&nbsp;ColognePhonetic()</pre>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method_detail">
<!--   -->
</a>
<h3>Method Detail</h3>
<a name="colognePhonetic(java.lang.String)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>colognePhonetic</h4>
<pre>public&nbsp;<a href="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;colognePhonetic(<a href="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;text)</pre>
<div class="block"><p>
 Implements the <i>K&ouml;lner Phonetik</i> algorithm.
 </p>
 <p>
 In contrast to the initial description of the algorithm, this implementation does the encoding in one pass.
 </p></div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>text</code> - </dd>
<dt><span class="strong">Returns:</span></dt><dd>the corresponding encoding according to the <i>K&ouml;lner Phonetik</i> algorithm</dd></dl>
</li>
</ul>
<a name="encode(java.lang.Object)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>encode</h4>
<pre>public&nbsp;<a href="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;encode(<a href="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;object)
              throws <a href="../../../../../org/apache/commons/codec/EncoderException.html" title="class in org.apache.commons.codec">EncoderException</a></pre>
<div class="block"><strong>Description copied from interface:&nbsp;<code><a href="../../../../../org/apache/commons/codec/Encoder.html#encode(java.lang.Object)">Encoder</a></code></strong></div>
<div class="block">Encodes an "Object" and returns the encoded content as an Object. The Objects here may just be
 <code>byte[]</code> or <code>String</code>s depending on the implementation used.</div>
<dl>
<dt><strong>Specified by:</strong></dt>
<dd><code><a href="../../../../../org/apache/commons/codec/Encoder.html#encode(java.lang.Object)">encode</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../../org/apache/commons/codec/Encoder.html" title="interface in org.apache.commons.codec">Encoder</a></code></dd>
<dt><span class="strong">Parameters:</span></dt><dd><code>object</code> - An object to encode</dd>
<dt><span class="strong">Returns:</span></dt><dd>An "encoded" Object</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../../org/apache/commons/codec/EncoderException.html" title="class in org.apache.commons.codec">EncoderException</a></code> - An encoder exception is thrown if the encoder experiences a failure condition during the encoding
             process.</dd></dl>
</li>
</ul>
<a name="encode(java.lang.String)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>encode</h4>
<pre>public&nbsp;<a href="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;encode(<a href="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;text)</pre>
<div class="block"><strong>Description copied from interface:&nbsp;<code><a href="../../../../../org/apache/commons/codec/StringEncoder.html#encode(java.lang.String)">StringEncoder</a></code></strong></div>
<div class="block">Encodes a String and returns a String.</div>
<dl>
<dt><strong>Specified by:</strong></dt>
<dd><code><a href="../../../../../org/apache/commons/codec/StringEncoder.html#encode(java.lang.String)">encode</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../../org/apache/commons/codec/StringEncoder.html" title="interface in org.apache.commons.codec">StringEncoder</a></code></dd>
<dt><span class="strong">Parameters:</span></dt><dd><code>text</code> - the String to encode</dd>
<dt><span class="strong">Returns:</span></dt><dd>the encoded String</dd></dl>
</li>
</ul>
<a name="isEncodeEqual(java.lang.String, java.lang.String)">
<!--   -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>isEncodeEqual</h4>
<pre>public&nbsp;boolean&nbsp;isEncodeEqual(<a href="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;text1,
                    <a href="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;text2)</pre>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!--   -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!--   -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/ColognePhonetic.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../org/apache/commons/codec/language/Caverphone2.html" title="class in org.apache.commons.codec.language"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../../org/apache/commons/codec/language/DoubleMetaphone.html" title="class in org.apache.commons.codec.language"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/commons/codec/language/ColognePhonetic.html" target="_top">Frames</a></li>
<li><a href="ColognePhonetic.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
  allClassesLink = document.getElementById("allclasses_navbar_bottom");
  if(window==top) {
    allClassesLink.style.display = "block";
  }
  else {
    allClassesLink.style.display = "none";
  }
  //-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_bottom">
<!--   -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright &#169; 2002-2013 <a href="http://www.apache.org/">The Apache Software Foundation</a>. All Rights Reserved.</small></p>
</body>
</html>
